/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dados.storyteller.vampiro;

/**
 *
 * @author yurifw
 */
public class RoladorDeDados {

    public String[] mascara (boolean especializacao, int parada, int dif) {
        int dez=0;
        int sucesso=0;
        int result;
        boolean critico=false;
        String [] rolagem={"","",""};
        /*
         * rolagem[0]=os resultados
         * rolagem[1]=qtd de sucessos
         * rolagem[2]=falha critica ou nao
         */

        if (parada==666) {
                rolagem[0] = "'Woe to you, Oh Earth and Sea, for the Devil sends the\n"
                        + "beast with wrath, because he knows the time is short...\n"
                        + "Let him who hath understanding reckon the number of the\n"
                        + "beast for it is a human number, its number is Six hundred and\n"
                        + "sixty six.\n'"
                        + "\n"
                        + "I left alone my mind was blank\n"
                        + "I needed time to think to get the memories from my mind\n"
                        + "\n"
                        + "What did I see can I believe that what I saw\n"
                        + "that night was real and not just fantasy\n"
                        + "\n"
                        + "Just what I saw in my old dreams were they\n"
                        + "reflections of my warped mind staring back at me\n"
                        + "\n"
                        + "'Cos in my dream it's always there the evil face that twists my mind\n"
                        + "and brings me to despair\n"
                        + "\n"
                        + "The night was black was no use holding back\n"
                        + "'Cos I just had to see was someone watching me\n"
                        + "In the mist dark figures move and twist\n"
                        + "Was this all for real or some kind of hell\n"
                        + "666 the number of the beast\n"
                        + "Hell and fire was spawned to be released\n"
                        + "\n"
                        + "Torches blazed and sacred chants were praised\n"
                        + "As they start to cry hands held to the sky\n"
                        + "In the night the fires burning bright\n"
                        + "The ritual has begun Satan's work is done\n"
                        + "666 the number of the beast\n"
                        + "Sacrifice is going on tonight\n"
                        + "\n"
                        + "This can't go on I must inform the law\n"
                        + "Can this still be real or just some crazy dream\n"
                        + "But I feel drawn towards the evil chanting hordes\n"
                        + "They seem to mesmerise me ... can't avoid their eyes\n"
                        + "666 the number of the beast\n"
                        + "666 the one for you and me\n"
                        + "\n"
                        + "I'm coming back I will return\n"
                        + "And I'll possess your body and I'll make you burn\n"
                        + "I have the fire I have the force\n"
                        + "I have the power to make my evil take it's course\n";
                return rolagem;
            } else {
                if (!especializacao) {
                    //critico= true;
                    for (int i = 0; i < parada; i++) {
                        result = Integer.parseInt((Math.random() * 10 + 1)+"");
                        if (result >= dif) {
                            critico = false;
                            sucesso++;
                        }

                        if (result == 1) {
                            sucesso--;
                        }
                        rolagem[0]=rolagem[0].concat("   " + result);
                        rolagem[1]="" + sucesso;
                        if (critico == true) {
                            rolagem[2]="critico";
                        }
                    }
                } else if (especializacao) {
                    critico = true;
                    dez = 0;
                    for (int i = 0; i < parada; i++) {
                        result = Integer.parseInt((Math.random() * 10 + 1)+"");

                        if (result == 1) {
                            sucesso--;
                            dez--;
                        }

                        if (result == 10) {
                            dez++;

                        }

                        if (dez > 0) {
                            parada++;
                            dez--;
                        }
                        if (result >= dif) {
                            sucesso++;
                            critico = false;
                        }
                        rolagem[0]=rolagem[0].concat("   " + result);
                    }
                    rolagem[1]="" + sucesso;
                        if (critico == true) {
                            rolagem[2]="critico";
                        }
                }
            }
        return rolagem;
    }


}
